import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import SoftwareDetail from '@/views/SoftwareDetail.vue'
import Feedback from '@/views/Feedback.vue'
import SoftwareList from '@/views/admin/SoftwareList.vue'
import SoftwareEdit from '@/views/admin/SoftwareEdit.vue'

const routes = [
  { path: '/', component: Home },
  { path: '/detail/:id', component: SoftwareDetail },
  { path: '/feedback', component: Feedback },
  { path: '/admin/software', component: SoftwareList },
  { path: '/admin/software/edit/:id?', component: SoftwareEdit }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
